// EDDataEntry.cpp: implementation of the EDDataEntry class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "EDDataEntry.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

IMPLEMENT_DYNCREATE(EDDataEntry,CObject)

EDDataEntry::EDDataEntry() : m_strDatabase ( _T ( "" ) ), m_strTable ( _T ( "" ) ), m_parKey ( NULL )
{
}

EDDataEntry::~EDDataEntry()
{
	if ( m_parKey )
	{
		for ( int i = 0; i < m_parKey->GetSize(); i++ )
		{
			delete m_parKey->GetAt ( i );
		}
		delete m_parKey;
	}
}

EDDataEntry::EDDataEntry ( const CString& strDb, const CString& strTb ) :
	m_strDatabase ( strDb ), m_strTable ( strTb )
{
}

	EDDataEntry::EDDataEntry ( const EDDataEntry& de ) :
m_strDatabase ( de.m_strDatabase ), m_strTable ( de.m_strTable )
{
	if ( de.m_parKey )
	{
		m_parKey = new CVarArray;
		for ( int i = 0; i < de.m_parKey->GetSize(); i++ )
		{
			m_parKey->Add ( new EDVariable ( *de.m_parKey->GetAt ( i ) ) );
		}
	}
}